/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package verins.beans;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author yi
 */
@Entity
@Table(name = "ubigeoxprocesoelectoral", schema = "verinscribe")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Ubigeoxprocesoelectoral.findAll", query = "SELECT u FROM Ubigeoxprocesoelectoral u"),
    @NamedQuery(name = "Ubigeoxprocesoelectoral.findByIdprocesoelectoral", query = "SELECT u FROM Ubigeoxprocesoelectoral u WHERE u.ubigeoxprocesoelectoralPK.idprocesoelectoral = :idprocesoelectoral"),
    @NamedQuery(name = "Ubigeoxprocesoelectoral.findByIdubigeo", query = "SELECT u FROM Ubigeoxprocesoelectoral u WHERE u.ubigeoxprocesoelectoralPK.idubigeo = :idubigeo")})
public class Ubigeoxprocesoelectoral implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected UbigeoxprocesoelectoralPK ubigeoxprocesoelectoralPK;
    @JoinColumn(name = "idubigeo", referencedColumnName = "idubigeo", nullable = false, insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tubigeo tubigeo;

    public Ubigeoxprocesoelectoral() {
    }

    public Ubigeoxprocesoelectoral(UbigeoxprocesoelectoralPK ubigeoxprocesoelectoralPK) {
        this.ubigeoxprocesoelectoralPK = ubigeoxprocesoelectoralPK;
    }

    public Ubigeoxprocesoelectoral(int idprocesoelectoral, String idubigeo) {
        this.ubigeoxprocesoelectoralPK = new UbigeoxprocesoelectoralPK(idprocesoelectoral, idubigeo);
    }

    public UbigeoxprocesoelectoralPK getUbigeoxprocesoelectoralPK() {
        return ubigeoxprocesoelectoralPK;
    }

    public void setUbigeoxprocesoelectoralPK(UbigeoxprocesoelectoralPK ubigeoxprocesoelectoralPK) {
        this.ubigeoxprocesoelectoralPK = ubigeoxprocesoelectoralPK;
    }

    public Tubigeo getTubigeo() {
        return tubigeo;
    }

    public void setTubigeo(Tubigeo tubigeo) {
        this.tubigeo = tubigeo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ubigeoxprocesoelectoralPK != null ? ubigeoxprocesoelectoralPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ubigeoxprocesoelectoral)) {
            return false;
        }
        Ubigeoxprocesoelectoral other = (Ubigeoxprocesoelectoral) object;
        if ((this.ubigeoxprocesoelectoralPK == null && other.ubigeoxprocesoelectoralPK != null) || (this.ubigeoxprocesoelectoralPK != null && !this.ubigeoxprocesoelectoralPK.equals(other.ubigeoxprocesoelectoralPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "verins.beans.Ubigeoxprocesoelectoral[ ubigeoxprocesoelectoralPK=" + ubigeoxprocesoelectoralPK + " ]";
    }
    
}
